package lockOb;

public class ThreadTest {

    public static void main(String[] args) {
        // 写法一：显示创建Thread
        Runnable runnable = new AbThread();
        Thread threadA = new Thread(runnable);
        Thread threadB = new Thread(runnable);
        threadA.start();
        threadB.start();
        // 写法二：使用线程池
//        ExecutorService executorService = Executors.newCachedThreadPool();
//        executorService.execute(runnable);
//        executorService.execute(runnable);
    }
}
